#pragma once
#include <tuple>
#include "DirectDrawFwd.h"
//#include "VideoSurfaceFwd.h"

namespace ja2{ namespace sgp
{
	//! Video surface scope locker.
	/*!
		We operate on DD surface because it will be needed only when setting data of DD surface.
	*/
	class VideoSurfaceLock : boost::noncopyable
	{
		// Attributes
	private:
		//! DD surface.
		IDirectDrawSurfacePtr &m_pSurface;
		//! Locking surface tuple <buffer, pitch>.
		std::tuple<void *, std::uint_least32_t> m_Data;

		// Operations
	public:
		//! Get buffer.
		void *buffer() const;
		//! Get pitch.
		std::uint_least32_t pitch() const;

		// Construction/Destruction
	public:
		VideoSurfaceLock(VideoSurfaceLock &&Move);
		VideoSurfaceLock(IDirectDrawSurfacePtr &pSurface);
		~VideoSurfaceLock();
	};
} /*sgp*/} /*ja2*/
